{%TEMPLATE->struct/head%}
{%TEMPLATE->struct/menu%}
<h2>Hashlist details</h2>
{%TEMPLATE->struct/messages%}
{{IF [[zap]]}}
  {%TEMPLATE->hashlists/zap%}
{{ENDIF}}
<div class="card">
  <div class="table-responsive">
    <table class="table table-bordered">
      <tr>
        <th>Property</th>
        <th>Value</th>
      </tr>
      <tr>
        <td>ID:</td>
        <td>[[list.getVal('hashlist')->getId()]]</td>
      </tr>
      <tr>
        <td>Member of Access Group:</td>
        <td>[[accessGroup.getGroupName()]]</td>
      </tr>
      <tr>
        <td>Name:</td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::MANAGE_HASHLIST_ACCESS]])]]}}
            <form class='form-inline' action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method="POST">
              <input type="hidden" name="action" value="[[$DHashlistAction::RENAME_HASHLIST]]">
              <input type="hidden" name="hashlist" value="[[list.getVal('hashlist')->getId()]]">
              <input type="hidden" name="csrf" value="[[csrf]]">
              <input type="text" class='form-control' name="name" size="20" value="[[list.getVal('hashlist')->getHashlistName()]]" title="Hashlist Name">&nbsp;&nbsp;
              <button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' data-toggle="tooltip" data-placement="top" title="Set"><i class="fas fa-save" aria-hidden="true"></i></button>
            </form>
          {{ELSE}}
            [[list.getVal('hashlist')->getHashlistName()]]
          {{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>
          Hashlist Notes
        </td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::MANAGE_HASHLIST_ACCESS]])]]}}
            <form class='form-inline' action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method="POST">
              <input type="hidden" name="action" value="[[$DHashlistAction::EDIT_NOTES]]">
              <input type="hidden" name="hashlist" value="[[list.getVal('hashlist')->getId()]]">
              <input type="hidden" name="csrf" value="[[csrf]]">
              <textarea class="form-control my-1" style="width: 100%" name="notes" title="Hashlist Notes" placeholder="Write hashlist notes here...">[[list.getVal('hashlist')->getNotes()]]</textarea>
              <button type="submit" class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}} my-1' data-toggle="tooltip" data-placement="top" title="Save"><i class="fas fa-save" aria-hidden="true"></i></button>
            </form>
          {{ELSE}}
            <textarea class="form-control my-1" style="width: 100%" name="notes" title="Hashlist Notes" placeholder="Write hashlist notes here..." disabled>[[list.getVal('hashlist')->getNotes()]]</textarea>
          {{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>Hash type:</td>
        <td>
          [[list.getVal('hashtype')->getDescription()]]
        </td>
      </tr>
      <tr>
        <td>Using hashcat brain:</td>
        <td>
          {{IF [[list.getVal('hashlist')->getBrainId()]]}}Yes (Brain Features: [[list.getVal('hashlist')->getBrainFeatures()]]){{ELSE}}No{{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>Format:</td>
        <td>
          [[Util::getStaticArray([[list.getVal('hashlist')->getFormat()]], 'formats')]]
          {{IF [[list.getVal('hashlist')->getHexSalt()]] == 1}}
            (salt in hex-format)
          {{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>Hashes:</td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}}
            <a href="hashes.php?hashlist=[[list.getVal('hashlist')->getId()]]">[[list.getVal('hashlist').getHashCount()]]</a>
          {{ELSE}}
            [[list.getVal('hashlist').getHashCount()]]
          {{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>Cracked:</td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}}
            <a href="hashes.php?hashlist=[[list.getVal('hashlist')->getId()]]&filter=cracked">[[list.getVal('hashlist').getCracked()]]</a>
          {{ELSE}}
            [[list.getVal('hashlist').getCracked()]]
          {{ENDIF}}
          ([[Util::showperc([[list.getVal('hashlist').getCracked()]], [[list.getVal('hashlist').getHashCount()]])]]%)
        </td>
      </tr>
      <tr>
        <td>Remaining:</td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::VIEW_HASHES_ACCESS]])]]}}
            <a href="hashes.php?hashlist=[[list.getVal('hashlist')->getId()]]&filter=uncracked">[[Util::calculate([[list.getVal('hashlist').getHashCount()]] - [[list.getVal('hashlist').getCracked()]])]]</a>
          {{ELSE}}
            [[Util::calculate([[list.getVal('hashlist').getHashCount()]] - [[list.getVal('hashlist').getCracked()]])]]
          {{ENDIF}}
          ([[Util::showperc([[list.getVal('hashlist').getHashCount()]] - [[list.getVal('hashlist').getCracked()]], [[list.getVal('hashlist').getHashCount()]])]]%)
        </td>
      </tr>
      <tr>
        <td>Secret:</td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::MANAGE_HASHLIST_ACCESS]])]]}}
            <form id="hashlistsecret" action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method="POST">
              <input type="hidden" name="hashlist" value="[[list.getVal('hashlist')->getId()]]">
              <input type="hidden" name="action" value="[[$DHashlistAction::SET_SECRET]]">
              <input type="hidden" name="csrf" value="[[csrf]]">
              <input title="Is Secret" type="checkbox" name="secret" value="1"{{IF [[list.getVal('hashlist')->getIsSecret()]] == 1}} checked{{ENDIF}}
              onChange="javascript:document.getElementById('hashlistsecret').submit();"> Hashlist contains secret data
            </form>
          {{ELSE}}
            <input title="Is Secret" type='checkbox'{{IF [[list.getVal('hashlist')->getIsSecret()]] == 1}} checked{{ENDIF}} disabled> Hashlist contains secret data
          {{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>Access Group:</td>
        <td>
          {{IF [[accessControl.hasPermission([[$DAccessControl::MANAGE_HASHLIST_ACCESS]])]]}}
            <form id="accessgroup" class="form-inline" action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method="POST">
              <input type="hidden" name="hashlist" value="[[list.getVal('hashlist')->getId()]]">
              <input type="hidden" name="action" value="[[$DHashlistAction::SET_ACCESS_GROUP]]">
              <input type="hidden" name="csrf" value="[[csrf]]">
              <select name="accessGroupId" class="form-control">
                {{FOREACH group;[[accessGroups]]}}
                  <option value="[[group.getId()]]"{{IF [[group.getId()]] == [[accessGroup.getId()]]}} selected{{ENDIF}}>[[group.getGroupName()]]</option>
                {{ENDFOREACH}}
              </select>
              <input type="submit" class="btn btn-light mx-1" value="Change Group">
            </form>
          {{ELSE}}
            [[accessGroup.getGroupName()]]
          {{ENDIF}}
        </td>
      </tr>
      <tr>
        <td>Actions:</td>
        <td>
          <div class="container-fluid" style="padding-left: 0;">
            <div class="row">
              <div class="col col-sm-12 my-1">
                {{IF [[list.getVal('hashlist')->getCracked()]] > 0 && [[accessControl.hasPermission([[$DAccessControl::MANAGE_HASHLIST_ACCESS]])]] && [[accessControl.hasPermission([[$DAccessControl::ADD_FILE_ACCESS]])]]}}
                  <form style='float: left; padding-right: 5px;' class="form-inline" action="report.php" method='get'>
                    <input type='hidden' name='hashlistId' value="[[list.getVal('hashlist')->getId()]]">
                    <select name="report" class="form-control">
                      {{FOREACH report;[[Util::scanReportDirectory('hashlist', true)]]}}
                        <option value="[[strtolower([[report]])]]">[[report]]</option>
                      {{ENDFOREACH}}
                    </select>
                    <input type='submit' class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}} mx-1' value='Download Report'>
                  </form>
                </div>
                <div class="col col-sm-12 my-1">
                  <form style='float: left; padding-right: 5px;' action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method='post'>
                    <input type='hidden' name='action' value='[[$DHashlistAction::CREATE_WORDLIST]]'>
                    <input type='hidden' name='hashlist' value="[[list.getVal('hashlist')->getId()]]">
                    <input type="hidden" name="csrf" value="[[csrf]]">
                    <input type='submit' class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value='Generate wordlist'>
                  </form>
                  <form style='float: left; padding-right: 5px;' action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method='post'>
                    <input type='hidden' name='action' value='[[$DHashlistAction::EXPORT_HASHLIST]]'>
                    <input type='hidden' name='hashlist' value="[[list.getVal('hashlist')->getId()]]">
                    <input type="hidden" name="csrf" value="[[csrf]]">
                    <input type='submit' class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value='Export hashes for pre-crack'>
                  </form>
                  <form style='float: left; padding-right: 5px;' action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method='post'>
                    <input type='hidden' name='action' value='[[$DHashlistAction::CREATE_LEFTLIST]]'>
                    <input type='hidden' name='hashlist' value="[[list.getVal('hashlist')->getId()]]">
                    <input type="hidden" name="csrf" value="[[csrf]]">
                    <input type='submit' class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value='Export left hashes'>
                  </form>
                {{ENDIF}}
                {{IF [[list.getVal('hashlist')->getCracked()]] < [[list.getVal('hashlist')->getHashCount()]] && [[accessControl.hasPermission([[$DAccessControl::MANAGE_HASHLIST_ACCESS]])]]}}
                  <form style='float: left;' action="hashlists.php?id=[[list.getVal('hashlist')->getId()]]" method='post'>
                    <input type='hidden' name='action' value='[[$DHashlistAction::ZAP_HASHLIST]]'>
                    <input type='hidden' name='hashlist' value="[[list.getVal('hashlist')->getId()]]">
                    <input type="hidden" name="csrf" value="[[csrf]]">
                    <input type='submit' class='btn {{IF [[toggledarkmode]] > 0}}btn-primary{{ELSE}}btn-light{{ENDIF}}' value='Import pre-cracked hashes'>
                  </form>
                {{ENDIF}}
              </div>
            </div>
          </div>
        </td>
      </tr>
    </table>
  </div>
</div>
{{IF [[list.getVal('hashlist')->getFormat()]] == 3 && [[sizeof([[sublists]])]]}}
  {%TEMPLATE->hashlists/detail/superhashlist%}
{{ENDIF}}
{{IF [[sizeof([[tasks]])]] > 0}}
  {%TEMPLATE->hashlists/detail/tasks%}
{{ENDIF}}
{{IF [[sizeof([[preTasks]])]] > 0}}
  {%TEMPLATE->hashlists/detail/pretasks%}
{{ENDIF}}
{{IF [[sizeof([[superTasks]])]] > 0}}
  {%TEMPLATE->hashlists/detail/supertasks%}
{{ENDIF}}
{%TEMPLATE->struct/foot%}
